package com.wy.demo.ftp;

import java.io.*;

public class FtpFileTransferDemo {

    // 实现延时 上传文件 上传文件中文件名称为 .now 上传完成之后变为 原本的名字。
    public static void main(String[] args) {
        String server = "192.168.126.100";
        int port = 21;
        String username = "dmadmin";
        String password = "wuyuxing001.";
        String localFilePath = "C:\\Users\\wy\\Desktop\\yhdb.sql";
        String remoteDirectory = "/home/dmadmin/ftpHome/";

        FtpFileTransfer transfer = new FtpFileTransfer();
        try {
            transfer.uploadFileWithTempSuffix(server, port, username, password,
                    localFilePath, remoteDirectory);
        } catch (IOException e) {
            System.err.println("传输失败: " + e.getMessage());
        }
    }
}
